Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mink driver selection ability in configuration #49

Merged
merged 2 commits into from
Mar 28, 2015

Conversation

aik099
Copy link
Member

@aik099 aik099 commented Mar 21, 2015

What's included in PR:

  1. new browser configuration parameters:
    • driver - selenium2 by default
    • driverOptions - empty array by default
  2. getter methods for browser configuration parameters replaced by __call method
  3. the api_username and api_key browser configuration parameters renamed to apiUsername and apiKey for consistency (no BC break because old parameter names still work)
  4. updated documentation to include new parameter usage examples

Supported drivers:

  • selenium2
  • goutte
  • sahi
  • zombie

I've copied over way how the driver is created and what parameters each driver factory can accept from MinkExtension, so this should be pretty flexible.

Closes #12
Replaces: #30

@aik099 aik099 force-pushed the driver-selection-support branch 2 times, most recently from f67f796 to 6475b8c Compare March 21, 2015 08:51
Vinai and others added 2 commits March 21, 2015 11:06
* add option for specifying Mink driver as part of the browser configuration
* set driver to 'selenium2' to preserve backwards compatibility
* add driver factories for Selenium2, Zombie, Goutte and Sahi drivers (only basic options supported)
* allows to register additional Mink drivers

For example, to configure a test to run with the Goutte driver, use

public static $browsers = array(
	array(
		'driver' => 'goutte',
    )
);

There also is a new configuration option 'driverOptions' which can be used by driver factories when instantiating the Mink driver.
It defaults to an empty arrray, places no restriction on the data structure and is currently not used by any of the driver factories.
1. Extracting driver factory registry into separate `DriverFactoryRegistry` class
2. Simplifying architecture by allowing `BrowserConfiguration` itself to create driver via new `createDriver` method, that uses above create factory to acquire proper driver factory
3. Eliminate getter methods for `BrowserConfiguration` parameters by using "__call" method
4. don't allow internal `type` `BrowserConfiguration` parameter to leave the `BrowserConfigurationFactory`
5. the `BrowserConfiguration::getType` method wasn't covered
6. allow DEV version of Mink to be used for testing purposes
7. allow each driver (via it's factory) to provide defaults for browser configuration
8. the "api_username" and "api_key" browser configuration parameters renamed to "apiUsername" and "apiKey" for consistency, but no BC break because old parameter names still work
9. updated documentation to include description of `driver` and `driverOptions` parameters
aik099 pushed a commit that referenced this pull request Mar 28, 2015
Mink driver selection ability in configuration
@aik099 aik099 merged commit 4f04e4f into minkphp:master Mar 28, 2015
@aik099 aik099 deleted the driver-selection-support branch March 28, 2015 12:08
@aik099 aik099 added this to the 2.1.0 milestone Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to specify driver in browser configuration
2 participants